/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #ff6b6b;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.score-container {
    display: flex;
    justify-content: center;
    gap: 50px;
}

.team {
    text-align: center;
}

.team h3 {
    margin-bottom: 10px;
    color: #4a4a4a;
}

.score {
    font-size: 2rem;
    font-weight: bold;
    background-color: #fff;
    border-radius: 10px;
    padding: 10px 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 80px;
    transition: all 0.3s ease;
}

.score.highlight {
    background-color: #ffeb3b;
    transform: scale(1.1);
}

/* 游戏区域样式 */
.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

/* 爆米花盒样式 */
.popcorn-box {
    width: 300px;
    height: 350px;
    margin-bottom: 30px;
    position: relative;
    perspective: 1000px;
}

.box-top {
    height: 50px;
    background-color: #ff6b6b;
    border-radius: 10px 10px 0 0;
    position: relative;
    transform-origin: bottom;
    transition: transform 0.5s ease;
}

.box-top::before, .box-top::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ff6b6b;
    top: -10px;
    border-radius: 50%;
}

.box-top::before {
    left: 100px;
}

.box-top::after {
    right: 100px;
}

.box-top.open {
    transform: rotateX(-110deg);
}

.box-content {
    height: 300px;
    background: repeating-linear-gradient(
        45deg,
        #ff6b6b,
        #ff6b6b 10px,
        #ff8e8e 10px,
        #ff8e8e 20px
    );
    border-radius: 0 0 10px 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    padding: 20px;
    overflow-y: auto;
    position: relative;
}

.empty-box-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    display: none;
}

/* 爆米花样式 */
.popcorn {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    margin: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
}

.popcorn:hover {
    transform: scale(1.1);
}

.popcorn::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ffeb3b;
    border-radius: 50%;
    top: 5px;
    left: 5px;
    opacity: 0.7;
}

/* 控制面板样式 */
.controls {
    display: flex;
    justify-content: center;
    gap: 30px;
    width: 100%;
    margin-top: 20px;
}

.control-panel, .question-panel {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 45%;
}

.control-panel h3, .question-panel h3 {
    margin-bottom: 15px;
    color: #4a4a4a;
    text-align: center;
}

.question-display {
    min-height: 100px;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.question-display p {
    margin-bottom: 8px;
}

.answer-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.hint-toggle {
    text-align: center;
}

/* 按钮样式 */
button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 5px;
}

#draw-popcorn, #reset-game, #show-tutorial {
    width: 100%;
    margin-bottom: 10px;
}

#draw-popcorn {
    background-color: #4ecdc4;
    color: white;
}

#draw-popcorn:hover {
    background-color: #3dbdb4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#reset-game {
    background-color: #ff6b6b;
    color: white;
}

#reset-game:hover {
    background-color: #ff5252;
}

#show-tutorial {
    background-color: #ffeb3b;
    color: #333;
}

#show-tutorial:hover {
    background-color: #fdd835;
}

#correct-answer {
    background-color: #6bd490;
    color: white;
}

#correct-answer:hover {
    background-color: #5bc480;
    transform: translateY(-2px);
}

#wrong-answer {
    background-color: #ff6b6b;
    color: white;
}

#wrong-answer:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
}

#toggle-hint {
    background-color: #ffeb3b;
    color: #333;
    width: 100%;
}

#toggle-hint:hover {
    background-color: #fdd835;
}

#add-question {
    background-color: #4ecdc4;
    color: white;
    width: 100%;
    margin-bottom: 10px;
}

#add-question:hover {
    background-color: #3dbdb4;
}

#add-sample-questions {
    background-color: #ffeb3b;
    color: #333;
    width: 100%;
}

#add-sample-questions:hover {
    background-color: #fdd835;
}

.primary-button {
    background-color: #4ecdc4;
    color: white;
    padding: 12px 20px;
    font-size: 1.1rem;
}

.primary-button:hover {
    background-color: #3dbdb4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 脉冲动画按钮 */
.pulse-button {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(78, 205, 196, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0);
    }
}

/* 游戏设置区域 */
.game-setup {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.game-setup h3 {
    margin-bottom: 15px;
    color: #4a4a4a;
    text-align: center;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.input-group select, .input-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

.input-group select:focus, .input-group textarea:focus {
    border-color: #4ecdc4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.2);
}

.input-group textarea {
    height: 80px;
    resize: vertical;
}

/* 游戏规则区域 */
.game-rules {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.game-rules h3, .game-rules h4 {
    margin-bottom: 15px;
    color: #4a4a4a;
    text-align: center;
}

.game-rules ol, .game-rules ul {
    padding-left: 20px;
}

.game-rules li {
    margin-bottom: 10px;
}

.game-tips {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 500px;
    text-align: center;
    position: relative;
    animation: popIn 0.5s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.tutorial-content {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 5% auto;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: #333;
}

.popcorn-animation {
    margin-bottom: 20px;
}

.popcorn-animation .popcorn {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-20px); }
}

.hint {
    font-style: italic;
    color: #666;
    margin-top: 10px;
    display: none;
}

.hint.visible {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* 教程步骤样式 */
.tutorial-step {
    display: flex;
    margin-bottom: 25px;
    align-items: flex-start;
}

.step-number {
    width: 30px;
    height: 30px;
    background-color: #4ecdc4;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content {
    text-align: left;
}

.step-content h3 {
    margin-bottom: 8px;
    color: #333;
}

.tutorial-image {
    max-width: 100%;
    border-radius: 5px;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 成功答题动画 */
.success-animation {
    margin: 20px 0;
    position: relative;
    height: 100px;
}

.star-burst {
    width: 60px;
    height: 60px;
    background-color: #ffeb3b;
    margin: 0 auto;
    position: relative;
    border-radius: 50%;
    animation: burst 0.8s ease-out;
}

@keyframes burst {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.star-burst::before, .star-burst::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffeb3b;
    border-radius: 50%;
}

.star-burst::before {
    transform: rotate(45deg);
}

.star-burst::after {
    transform: rotate(90deg);
}

.points-animation {
    font-size: 2rem;
    font-weight: bold;
    color: #6bd490;
    animation: flyUp 1.5s ease-out;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes flyUp {
    0% {
        transform: translate(-50%, 0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -100px);
        opacity: 0;
    }
}

/* 帮助按钮 */
.help-button {
    background-color: #ffeb3b;
    color: #333;
    position: relative;
}

.help-button::after {
    content: '?';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: #ff6b6b;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-panel, .question-panel {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .popcorn-box {
        width: 250px;
        height: 300px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}
/* 标签页样式 */
.rules-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    background-color: #f5f5f5;
    border: none;
    padding: 10px 15px;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background-color: #e0e0e0;
}

.tab-button.active {
    background-color: #4ecdc4;
    color: white;
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 0 0 5px 5px;
    margin-bottom: 15px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

/* 答题指南样式 */
.answer-guide {
    background-color: #fff3cd;
    padding: 10px;
    border-left: 4px solid #ffc107;
    margin: 10px 0;
    border-radius: 0 5px 5px 0;
}

/* 正确答案样式 */
.correct-answer {
    color: #28a745;
    font-weight: bold;
    margin-top: 10px;
}

/* 资源按钮样式 */
.resource-button {
    background-color: #6c757d;
    color: white;
    width: 100%;
}

.resource-button:hover {
    background-color: #5a6268;
}
/* 重置按钮样式 */
.reset-button {
    background-color: #dc3545;
    color: white;
    width: 100%;
    margin-top: 10px;
}

.reset-button:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
